#ifndef BE0B3B46_BDE4_4462_81FF_66245D6599A3
#define BE0B3B46_BDE4_4462_81FF_66245D6599A3

#include<iostream>

//定义枚举类， 枚举出日志等级。
//提供转换接口， 将枚举转化为对应字符串。

namespace mian_yang
{
    class LogLevel
    {
    public:
        enum class value
        {
            UNKNOW = 0,
            DEBUG,
            INFO,
            WARN,
            ERROR,
            FATAL,
            OFF
        };

        static const char* toString(LogLevel::value level)
        {
            switch(level)
            {
                case LogLevel::value::DEBUG: return "DEBUG";
                case LogLevel::value::INFO: return "INFO";
                case LogLevel::value::WARN: return "WARN";
                case LogLevel::value::ERROR: return "ERROR";
                case LogLevel::value::FATAL: return "FATAL";
                case LogLevel::value::OFF: return "OFF";
            }
            return "UNKNOW";
        }


        static void TestLevel()
        {
            std::cout << mian_yang::LogLevel::toString(mian_yang::LogLevel::value::DEBUG) << std::endl;
        }


    };
}


#endif /* BE0B3B46_BDE4_4462_81FF_66245D6599A3 */
